<?php
/**
 * CreateTime: 2023/11/16 15:31
 * User:LinQ
 */

namespace Database\Seeders\Database;

use App\Func\User\UserFunc;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Symfony\Component\Uid\UuidV4;

class CompanySeeder extends Seeder
{
    public function run()
    {
        $isExists = DB::table('s_company')->select('company_id')->where('company_name','admin')->first();
        if(!$isExists){
            DB::table('s_company')->insert([
                'company_name' => 'admin',
                'company_code' => Str::random(10),
                'company_union_id' => UuidV4::v6()->toRfc4122(),
                'created_at' => date("Y-m-d h:i:s"),
                'updated_at' => date("Y-m-d h:i:s"),
            ]);
        }
    }
}